//
//  DingDanHomeViewController.m
//  ShangChengMoBan
//
//  Created by 军 on 16/8/29.
//  Copyright © 2016年 ping. All rights reserved.
//

#import "DingDanHomeViewController.h"
#import "YSLContainerViewController.h"
#import "DingDanMainViewController.h"
@interface DingDanHomeViewController ()<YSLContainerViewControllerDelegate>

@end

@implementation DingDanHomeViewController

- (void)viewDidLoad {
    [self jianCeLogin];
    self.view.backgroundColor = [UIColor whiteColor];
    DingDanMainViewController * all =[[DingDanMainViewController alloc]init];
    all.title =@"全部";
    all.num = 1;
    if (_item == 0) {
        [all requestData:nil :1];
    }
    DingDanMainViewController * fuKuan =[[DingDanMainViewController alloc]init];
    fuKuan.title =@"待付款";
    fuKuan.num = 2;
    DingDanMainViewController * faHuo =[[DingDanMainViewController alloc]init];
    faHuo.title =@"待发货";
    faHuo . num = 3;
    DingDanMainViewController * shouHuo =[[DingDanMainViewController alloc]init];
    shouHuo.title =@"待收货";
    shouHuo.num = 4;
    DingDanMainViewController * pingLun =[[DingDanMainViewController alloc]init];
    pingLun.title =@"待评论";
    pingLun. num = 5;
    YSLContainerViewController * ysl = [[YSLContainerViewController alloc]initWithControllers:@[all,fuKuan,faHuo,shouHuo,pingLun] topBarHeight:64 parentViewController:self : _item];
    ysl.delegate = self;
    ysl.menuBackGroudColor = [UIColor whiteColor];
    ysl.menuItemSelectedTitleColor =[UIColor colorWithHue:0.96 saturation:1.00 brightness:1.00 alpha:1.00];
    ysl.menuIndicatorColor = [UIColor colorWithHue:0.96 saturation:1.00 brightness:1.00 alpha:1.00];
    ysl.menuItemTitleColor = MaintextColor;

    [self.view addSubview:ysl.view];
    [self drawNavWithTitle:@"我的订单" WithColor:[UIColor colorWithHue:0.00 saturation:0.00 brightness:1.00 alpha:1.00]];
    [self drawBackButton];
    [ysl xuanZe:_item];
    

}

-(void)clickBack{
    [self.navigationController popToRootViewControllerAnimated:YES];
}

- (void)containerViewItemIndex:(NSInteger)index currentController:(UIViewController *)controller{
   [((DingDanMainViewController*)controller) requestDatasWith];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
